#ifndef ACTIVITYITEM_H
#define ACTIVITYITEM_H
#include <QString>
#include <QDateTime>
#include <QObject>

class ActivityItemType : public QObject
{
    Q_OBJECT
    //
    Q_PROPERTY(QString activityParentSid READ activityParentSid WRITE setActivityParentSid NOTIFY activityParentSidChanged)
    Q_PROPERTY(QString activityParentName READ activityParentName WRITE setActivityParentName NOTIFY activityParentNameChanged)
    Q_PROPERTY(QString activityGroupSid READ activityGroupSid WRITE setActivityGroupSid NOTIFY activityGroupSidChanged)
    //
    Q_PROPERTY(QString activitiesSid READ activitiesSid WRITE setActivitiesSid NOTIFY activitiesSidChanged)
    Q_PROPERTY(int serialNumberInLayer READ serialNumberInLayer WRITE setSerialNumberInLayer NOTIFY serialNumberInLayerChanged)
    Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
    Q_PROPERTY(QString note READ note WRITE setNote NOTIFY noteChanged)
    Q_PROPERTY(QString type READ type WRITE setType NOTIFY typeChanged)
    Q_PROPERTY(QString status READ status WRITE setStatus NOTIFY statusChanged)
    Q_PROPERTY(int isAutoCompleted READ isAutoCompleted WRITE setIsAutoCompleted NOTIFY isAutoCompletedChanged)
    Q_PROPERTY(int isLastActivityEndAllProjecCompleted READ isLastActivityEndAllProjecCompleted WRITE setIsLastActivityEndAllProjecCompleted NOTIFY isLastActivityEndAllProjecCompletedChanged)
    //
    Q_PROPERTY(int timeType READ timeType WRITE setTimeType NOTIFY timeTypeChanged)//+east-west +8 is beijing time
    Q_PROPERTY(QDateTime addTime READ addTime WRITE setAddTime NOTIFY addTimeChanged)//添加时间
    Q_PROPERTY(QDateTime editTiem READ editTiem WRITE setEditTiem NOTIFY editTiemChanged)//编辑时间
    Q_PROPERTY(QDateTime estimatedTime READ estimatedTime WRITE setEstimatedTime NOTIFY estimatedTimeChanged)//预计完成时间
    Q_PROPERTY(QDateTime DeferUntilTime READ DeferUntilTime WRITE setDeferUntilTime NOTIFY DeferUntilTimeChanged)
    Q_PROPERTY(QDateTime completedTime READ completedTime WRITE setCompletedTime NOTIFY completedTimeChanged)//完成时间
    //repeat
    Q_PROPERTY(QDateTime nextTime READ nextTime WRITE setNextTime NOTIFY nextTimeChanged)
    Q_PROPERTY(QDateTime nextTestTime READ nextTestTime WRITE setNextTestTime NOTIFY nextTestTimeChanged)
    Q_PROPERTY(double passTime READ passTime WRITE setpassTime NOTIFY passTimeChanged)
    Q_PROPERTY(QString passTimeType READ passTimeType WRITE setPassTimeType NOTIFY passTimeTypeChanged)
    //
    Q_PROPERTY(int catalogueSid READ catalogueSid WRITE setCatalogueSid NOTIFY catalogueSidChanged)
    Q_PROPERTY(QString catalogueName READ catalogueName WRITE setCatalogueName NOTIFY catalogueNameChanged)
    Q_PROPERTY(QString flagName READ flagName WRITE setFlagName NOTIFY flagNameChanged)
    Q_PROPERTY(int contextSid READ contextSid WRITE setContextSid NOTIFY contextSidChanged)
    Q_PROPERTY(QString contextName READ contextName WRITE setContextName NOTIFY contextNameChanged)
    //TODO: 任务的人员列表，花钱，资源等
//    explicit ActivityItemType(int activiesSid, int contextSid, int parentactiviesSid, int parentactiviesName,
//                          int parentactiviesserialNumberInThisLayer, int serialNumberInThisLayer,
//                          QString contextName, int groupSid,int groupName,int FlagedName,QString title,
//                          QString note,QString type, QString Status,int isAutoCompleted,QDateTime insertTime,
//                          QDateTime newEditTime, QDateTime EstimatedTime, QDateTime DeferUntilTime,
//                          QDateTime CompletedTime, QList<double> NextTimeLong, long NextTimeLongList,QString everyTimeNme,
//                          bool isOpened);
public:
    explicit ActivityItemType(QObject *parent = 0);
    ActivityItemType(const ActivityItemType &other);
    ~ActivityItemType();
public:
    QString activityParentSid() const;
    QString activityParentName() const;
    QString activityGroupSid() const;
    QString activitiesSid() const;
    int serialNumberInLayer() const;
    QString title() const;
    QString note() const;
    QString type() const;
    QString status() const;
    int isAutoCompleted() const;
    int isLastActivityEndAllProjecCompleted() const;
    int timeType() const;
    QDateTime addTime() const;
    QDateTime editTiem() const;
    QDateTime estimatedTime() const;
    QDateTime DeferUntilTime() const;
    QDateTime completedTime() const;
    QDateTime nextTime() const;
    QDateTime nextTestTime() const;
    double passTime() const;
    QString passTimeType() const;
    int catalogueSid() const;
    QString catalogueName() const;
    QString flagName() const;
    int contextSid() const;
    QString contextName() const;
public slots:
    void setActivityParentSid(QString activityParentSid);
    void setActivityParentName(QString activityParentName);
    void setActivityGroupSid(QString activityGroupSid);
    void setActivitiesSid(QString activitiesSid);
    void setSerialNumberInLayer(int serialNumberInLayer);
    void setTitle(QString title);
    void setNote(QString note);
    void setType(QString type);
    void setStatus(QString status);
    void setIsAutoCompleted(int isAutoCompleted);
    void setIsLastActivityEndAllProjecCompleted(int isLastActivityEndAllProjecCompleted);
    void setTimeType(int timeType);
    void setAddTime(QDateTime addTime);
    void setEditTiem(QDateTime editTiem);
    void setEstimatedTime(QDateTime estimatedTime);
    void setDeferUntilTime(QDateTime DeferUntilTime);
    void setCompletedTime(QDateTime completedTime);
    void setNextTime(QDateTime nextTime);
    void setNextTestTime(QDateTime nextTestTime);
    void setpassTime(double passTime);
    void setPassTimeType(QString passTimeType);
    void setCatalogueSid(int catalogueSid);
    void setCatalogueName(QString catalogueName);
    void setFlagName(QString flagName);
    void setContextSid(int contextSid);
    void setContextName(QString contextName);
signals:
    void activityParentSidChanged(QString activityParentSid);
    void activityParentNameChanged(QString activityParentName);
    void activityGroupSidChanged(QString activityGroupSid);
    void activitiesSidChanged(QString activitiesSid);
    void serialNumberInLayerChanged(int serialNumberInLayer);
    void titleChanged(QString title);
    void noteChanged(QString note);
    void typeChanged(QString type);
    void statusChanged(QString status);
    void isAutoCompletedChanged(int isAutoCompleted);
    void isLastActivityEndAllProjecCompletedChanged(int isLastActivityEndAllProjecCompleted);
    void timeTypeChanged(int timeType);
    void addTimeChanged(QDateTime addTime);
    void editTiemChanged(QDateTime editTiem);
    void estimatedTimeChanged(QDateTime estimatedTime);
    void DeferUntilTimeChanged(QDateTime DeferUntilTime);
    void completedTimeChanged(QDateTime completedTime);
    void nextTimeChanged(QDateTime nextTime);
    void nextTestTimeChanged(QDateTime nextTestTime);
    void passTimeChanged(double passTime);
    void passTimeTypeChanged(QString passTimeType);
    void catalogueSidChanged(int catalogueSid);
    void catalogueNameChanged(QString catalogueName);
    void flagNameChanged(QString flagName);
    void contextSidChanged(int contextSid);
    void contextNameChanged(QString contextName);

private:
    QString m_activityParentSid;
    QString m_activityParentName;
    QString m_activityGroupSid;
    QString m_activitiesSid;
    int m_serialNumberInLayer;
    QString m_title;
    QString m_note;
    QString m_type;
    QString m_status;
    int m_isAutoCompleted;
    int m_isLastActivityEndAllProjecCompleted;
    int m_timeType;
    QDateTime m_addTime;
    QDateTime m_editTiem;
    QDateTime m_estimatedTime;
    QDateTime m_DeferUntilTime;
    QDateTime m_completedTime;
    QDateTime m_nextTime;
    QDateTime m_nextTestTime;
    double m_passTime;
    QString m_passTimeType;
    int m_catalogueSid;
    QString m_catalogueName;
    QString m_flagName;
    int m_contextSid;
    QString m_contextName;
};
Q_DECLARE_METATYPE(ActivityItemType)
#endif // ACTIVITYITEM_H
